package y23.Sep;

class MobilePhone{
    String brand;//品牌
    String colour;//颜色

    public void printPhone(){
        System.out.println("这是一台"+colour+ "的"+brand+"手机");
    }
}

public class eg2 {
    public static void main(String[] args) {
        MobilePhone mobilePhone1 = new MobilePhone();
        mobilePhone1.brand = "华为";
        mobilePhone1.colour = "白色";
        mobilePhone1.printPhone();
        MobilePhone mobilePhone2 = new MobilePhone();
        mobilePhone2.brand = "苹果";
        mobilePhone2.colour = "黑色";
        mobilePhone2.printPhone();
    }
}
